﻿<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<html>
<head>
    <title>日志查询界面</title>
    <link type="text/css" rel="stylesheet" href='<spring:url value="/webjars/bootstrap/3.3.5/css/bootstrap.min.css"/>'/>
    <link type="text/css" rel="stylesheet"
          href='<spring:url value="/webjars/bootstrap/3.3.5/css/bootstrap-theme.min.css"/>'/>
    <link type="text/css" rel="stylesheet" href='<spring:url value="/resources/css/content.css"/>'/>
    <link type="text/css" rel="stylesheet"
          href='<spring:url value="/resources/css/bootstrap-datetimepicker.min.css"/>'/>
    <script src='<spring:url value="/webjars/jquery/1.11.1/jquery.min.js"/>'></script>
    <script src='<spring:url value="/webjars/bootstrap/3.3.5/js/bootstrap.js"/>'></script>
    <script src='<spring:url value="/webjars/angularjs/1.5.5/angular.min.js"/>'></script>
    <script src='<spring:url value="/webjars/angularjs/1.5.5/angular-resource.js"/>'></script>
    <script src='<spring:url value="/webjars/bootbox/4.4.0/bootbox.js"/>'></script>
    <script src='<spring:url value="/resources/js/common/bootstrap-datetimepicker.min.js"/>'></script>
    <script src='<spring:url value="/resources/js/common/PageUtil.js"/>'></script>
    <script src='<spring:url value="/resources/js/common/Constant.js"/>'></script>
    <script src='<spring:url value="/resources/js/common/MessageBox.js"/>'></script>
    <script src='<spring:url value="/resources/js/log/LogModel.js"/>'></script>
    <script src='<spring:url value="/resources/js/log/LogService.js"/>'></script>
    <script src='<spring:url value="/resources/js/log/LogController.js"/>'></script>
</head>
<body ng-app="app" ng-controller="logCtrl">
<div class="adcc-container">
    <ol class="breadcrumb">
        <li class="active">系统管理</li>
        <li class="active">日志查询</li>
    </ol>
    <form class="form-inline" method="post">
        <div class="form-group">
            <label class="control-label">日志级别</label>
            <select class="form-control" ng-model="searchLevel" ng-init="searchLevel=''">
                <option value="">--</option>
                <option value="0">信息</option>
                <option value="1">警告</option>
                <option value="2">严重</option>
                <option value="3">致命</option>
            </select>

            <div class="input-group date" data-provide="datepicker">
                <input id="dateStart" type="datetime" class="datetimepicker" data-provide="datetimepicker-inline"
                       ng-model="searchDateStart" placeholder="开始时间" readonly>
            </div>
            <div class="input-group date" data-provide="datepicker">
                <input id="dateEnd" type="datetime" class="datetimepicker" data-provide="datetimepicker-inline"
                       ng-model="searchDateEnd" placeholder="结束时间" readonly>
            </div>
            <input id="queryOperateName" type="text" class="form-control" ng-model="queryOperateName"
                   placeholder="查询用户">
            <input id="queryKeyword" type="text" class="form-control" ng-model="queryKeyword" placeholder="日志内容查询关键字">
            <button type="submit" ng-click="findByConditions()" class="btn btn-primary">查询</button>
        </div>
    </form>


    <table id="logTable" class="table table-bordered" style="margin-bottom: 0px;">
        <thead>
        <tr>
            <th width="450px">时间</th>
            <th width="360px">用户</th>
            <th>日志</th>
        </tr>
        </thead>
    </table>
    <div class="adcc-log-content">
        <table class="table table-bordered table-condensed table-hover">
            <tbody>
            <tr id="logRow" ng-repeat="x in messages" ng-style="changColor(x.level)">
                <td width="450px">{{x.createTime }}</td>
                <td width="360px">{{x.name}}</td>
                <td class="bubble-title" data-toggle="tooltip" data-placement="top" title="{{x.log }}">{{x.log }}</td>
            </tr>
            </tbody>
        </table>
    </div>


    <nav class="form-inline">
        <ul class="pagination">
            <li id="top" class="input-group">
                <a ng-click="firstPage()">
                    <span>首页</span>
                </a>
            </li>
            <li id="previous" class="input-group">
                <a ng-click="previous()">
                    <span>上一页</span>
                </a>
            </li>
            <li ng-repeat="page in pageList" ng-class="{active: isActivePage(page)}" class="input-group">
                <a ng-click="selectCurrentPage(page)" class="form-control">{{ page }}</a>
            </li>
            <li id="next" class="input-group">
                <a ng-click="next()">
                    <span>下一页</span>
                </a>
            </li>
            <li id="bottom" class="input-group">
                <a ng-click="lastPage()">
                    <span>尾页</span>
                </a>
            </li>
            <li class="input-group">
                <%--可设置默认条数--%>
                <select ng-model="selectPageSize" class="form-control" ng-init="selectPageSize='25'"
                        ng-change="changePageSize(selectPageSize)">
                    <option value="25">25</option>
                    <option value="50">50</option>
                    <option value="100">100</option>
                </select>
            </li>
        </ul>
    </nav>
</div>
</body>
</html>
